<?php
    $totalArticleHot    = (!empty($this->arrArticleHot) && is_array($this->arrArticleHot))?count($this->arrArticleHot):0;
?>
<div class="block250 w250" id="baithi">
    <div class="contents usual">
        <ul class="idTabs">
            <li class="alltab"><a href="#tab_noibat" class="selected">Bài thi nổi bật</a></li>
            <li class="alltab"><a href="#tab_moinhat">Bài thi mới nhất</a></li>
        </ul>
        <div id="tab_noibat" class="content_tab" style="display:block;">
        <?php if ( $totalArticleHot > 0 ) {?>
            <ul>
            <?php foreach ( $this->arrArticleHot as $key=>$row ) {?>
                <li>
                <?php if ( !empty($row['image']) ) {?>
                    <a href="<?php echo $this->MakeUrlSite(1, array('title'=>$row['title'], 'id'=>$row['articleid']));?>" title="<?php echo $this->escape($row['title']);?>"><img src="<?php echo UPLOAD_URL_CLUB.$row['image'];?>" align="absmiddle" width="100" height="77" title="<?php echo $this->escape($row['title']);?>" /></a>
                <?php }//end if?>
                    <div class="info">
                        <p><a class="title" href="<?php echo $this->MakeUrlSite(1, array('title'=>$row['title'], 'id'=>$row['articleid']));?>" title="<?php echo $this->escape($row['title']);?>"><?php echo $this->escape($row['title']);?></a></p>
                        <p>Gửi bởi: <a class="widget" href="<?php echo BANBE_URL;?>/<?php echo $row['userid'];?>/profile" rel="FPTD_<?php echo $row['userid'];?>?sub=45" target="_blank"></a> | <?php echo $this->DateTimeDiff($row['creation_time']);?></p>
                        <p class="bg_black">
                            <label><?php echo $row['total_view'];?></label>
                            lượt xem |
                            <label><?php echo $row['total_vote'];?></label>
                            bình chọn</p>
                    </div>
                </li>
            <?php }//end if?>
            </ul>
            <p class="view_all"><a href="<?php echo $this->MakeUrlSite(3, array('page'=>1));?>">Xem tất cả</a></p>
        <?php } else {?>
            <p>Không có bài dự thi nổi bật</p>
        <?php }//end if?>
        </div>
    
        <div id="tab_moinhat" class="content_tab" style="display:block;">
        <?php if ( $this->arrArticlePost['total']>0 && !empty($this->arrArticlePost['list']) && is_array($this->arrArticlePost['list']) ) {?>
            <ul>
            <?php foreach ( $this->arrArticlePost['list'] as $key=>$row ) {?>
                <li>
                <?php if ( !empty($row['image']) ) {?>
                    <a href="<?php echo $this->MakeUrlSite(1, array('title'=>$row['title'], 'id'=>$row['articleid']));?>" title="<?php echo $this->escape($row['title']);?>"><img src="<?php echo UPLOAD_URL_CLUB.$row['image'];?>" align="absmiddle" width="100" height="77" title="<?php echo $this->escape($row['title']);?>" /></a>
                <?php }//end if?>
                    <div class="info">
                        <p><a class="title" href="<?php echo $this->MakeUrlSite(1, array('title'=>$row['title'], 'id'=>$row['articleid']));?>" title="<?php echo $this->escape($row['title']);?>"><?php echo $this->escape($row['title']);?></a></p>
                        <p>Gửi bởi: <a class="widget" href="<?php echo BANBE_URL;?>/<?php echo $row['userid'];?>/profile" rel="FPTD_<?php echo $row['userid'];?>?sub=45" target="_blank"></a> | <?php echo $this->DateTimeDiff($row['creation_time']);?></p>
                        <p class="bg_black">
                            <label><?php echo $row['total_view'];?></label>
                            lượt xem |
                            <label><?php echo $row['total_vote'];?></label>
                            bình chọn</p>
                    </div>
                </li>
            <?php }//end foreach?>
            </ul>
            <p class="view_all"><a href="<?php echo $this->MakeUrlSite(2, array('page'=>1));?>">Xem tất cả</a></p>
        <?php } else {?>
            <p>Không có bài dự thi</p>
        <?php }//end if?>
        </div>
    </div>
</div>